package com.black.play.entity;

/**
 * 方向枚举类
 *
 * @author ylx
 */
public enum Direction
{
    UP,
    DOWN,
    LEFT,
    RIGHT,
    ;

    /**
     * 反向方法
     *
     * @return 方向枚举
     */
    public Direction reverse()
    {
        switch (this)
        {
            case UP:
                return DOWN;
            case DOWN:
                return UP;
            case LEFT:
                return RIGHT;
            case RIGHT:
                return LEFT;
            default:
                return null;
        }
    }
}
